#include <bits/stdc++.h>
using namespace std;

int main() {
	int n; cin >> n;
	for(int i = n;i >= 0;i --)
	{
		int x; cin >> x;
		// 系数
		if(x == 0) continue;
		if(x > 0)
		{
			if(i != n) cout << "+";
			if(x != 1 || i == 0) cout << x;
		}
		else
		{
			cout << "-";
			if(x != -1 || i == 0) cout << abs(x);
		}
		// 指数
		if(i == 1) cout << "x";
		else if(i > 1) cout << "x^" << i;
	}
	return 0;
}